/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package facturacion;

import java.awt.HeadlessException;
import java.awt.Image;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.NumberFormat;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;

/**
 *
 * @author CEBALLOS
 */
public final class Productos extends javax.swing.JFrame {

    /**
     * Creates new form Productos
     */
    public Productos() {
        initComponents();
        conectar();
        TxtId.setEnabled(false);
        Guardar.setEnabled(false);
        BtnCancelar.setEnabled(false);
      
    }
    
    int Constante =100;// constante para valores en DB EX_MAX  EX_MIN
    
    
    @Override
    public Image getIconImage(){
    
        Image retValue = Toolkit.getDefaultToolkit().getImage(ClassLoader.getSystemResource("IMAGENES/icon.png"));
    return retValue;
    }
   
    Connection conexion;  //  @jve:decl-index=0:
    Statement sentencia,sentenciaventas,sentenciaxreg;  //  @jve:decl-index=0:
    ResultSet resultado,resultadoventas,resultadoxreg;
    int xregistros;
    boolean nuevoreg;
    String elcodigo= ""; 
    
    

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        TxtPVP = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        BtnPrimerArt = new javax.swing.JButton();
        BtnAnteriorArt = new javax.swing.JButton();
        BtnBuscarArt = new javax.swing.JButton();
        BtnSiguienteArt = new javax.swing.JButton();
        BtnUltimoArt = new javax.swing.JButton();
        jLabelProducto = new javax.swing.JLabel();
        TxtId = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        TxtNombre = new javax.swing.JTextField();
        jLabelNombre = new javax.swing.JLabel();
        jLabelPrecioCompra = new javax.swing.JLabel();
        TxtPrecioCompra = new javax.swing.JTextField();
        jLabelCantidad = new javax.swing.JLabel();
        TxtCantidad = new javax.swing.JTextField();
        jLabelMarca = new javax.swing.JLabel();
        TxtMarca = new javax.swing.JTextField();
        jLabelPrecioVenta = new javax.swing.JLabel();
        TxtPrecioVenta = new javax.swing.JTextField();
        jLabelMarca1 = new javax.swing.JLabel();
        TxtPais = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        Nuevo = new javax.swing.JButton();
        BtnModificar = new javax.swing.JButton();
        Guardar = new javax.swing.JButton();
        BtnCancelar = new javax.swing.JButton();
        BtnEliminar = new javax.swing.JButton();
        BtnSalir = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        TxtPVP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                TxtPVPActionPerformed(evt);
            }
        });
        TxtPVP.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                TxtPVPKeyTyped(evt);
            }
        });

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setIconImage(getIconImage());
        setResizable(false);

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        BtnPrimerArt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/PRIMERO.JPG"))); // NOI18N
        BtnPrimerArt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnPrimerArtActionPerformed(evt);
            }
        });

        BtnAnteriorArt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/ANTERIOR.JPG"))); // NOI18N
        BtnAnteriorArt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnAnteriorArtActionPerformed(evt);
            }
        });

        BtnBuscarArt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/BUSCAR.JPG"))); // NOI18N
        BtnBuscarArt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnBuscarArtActionPerformed(evt);
            }
        });

        BtnSiguienteArt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/SIGUIENTE.JPG"))); // NOI18N
        BtnSiguienteArt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnSiguienteArtActionPerformed(evt);
            }
        });

        BtnUltimoArt.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/ULTIMO.JPG"))); // NOI18N
        BtnUltimoArt.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnUltimoArtActionPerformed(evt);
            }
        });

        jLabelProducto.setText("ID PRODUCTO");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabelProducto)
                .addGap(37, 37, 37)
                .addComponent(TxtId, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 179, Short.MAX_VALUE)
                .addComponent(BtnPrimerArt, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BtnAnteriorArt, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BtnBuscarArt, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BtnSiguienteArt, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BtnUltimoArt, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(3, 3, 3)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(TxtId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelProducto)))
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(BtnPrimerArt, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(BtnAnteriorArt, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(BtnBuscarArt, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(BtnSiguienteArt, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(BtnUltimoArt, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabelNombre.setText("NOMBRE");

        jLabelPrecioCompra.setText("PrecioCompra");

        TxtPrecioCompra.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                TxtPrecioCompraFocusLost(evt);
            }
        });
        TxtPrecioCompra.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                TxtPrecioCompraKeyTyped(evt);
            }
        });

        jLabelCantidad.setText("STOCK");

        TxtCantidad.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                TxtCantidadKeyTyped(evt);
            }
        });

        jLabelMarca.setText("MARCA");

        jLabelPrecioVenta.setText("PrecioVenta");

        TxtPrecioVenta.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                TxtPrecioVentaFocusLost(evt);
            }
        });
        TxtPrecioVenta.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                TxtPrecioVentaKeyTyped(evt);
            }
        });

        jLabelMarca1.setText("PAIS");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabelMarca)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(TxtMarca, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addComponent(jLabelNombre)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(TxtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(10, 10, 10))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabelMarca1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(TxtPais, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabelCantidad)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(TxtCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabelPrecioCompra)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 39, Short.MAX_VALUE)
                        .addComponent(TxtPrecioCompra, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(jLabelPrecioVenta)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(TxtPrecioVenta, javax.swing.GroupLayout.PREFERRED_SIZE, 506, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelNombre)
                    .addComponent(TxtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelMarca)
                    .addComponent(TxtMarca, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelMarca1)
                    .addComponent(TxtPais, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelCantidad)
                    .addComponent(TxtCantidad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPrecioCompra)
                    .addComponent(TxtPrecioCompra, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelPrecioVenta)
                    .addComponent(TxtPrecioVenta, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(28, Short.MAX_VALUE))
        );

        jPanel5.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        Nuevo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/NUEVO.JPG"))); // NOI18N
        Nuevo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                NuevoActionPerformed(evt);
            }
        });

        BtnModificar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/MODIFICAR.JPG"))); // NOI18N
        BtnModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnModificarActionPerformed(evt);
            }
        });

        Guardar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/GUARDAR2.JPG"))); // NOI18N
        Guardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                GuardarActionPerformed(evt);
            }
        });

        BtnCancelar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/CANCELAR.JPG"))); // NOI18N
        BtnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnCancelarActionPerformed(evt);
            }
        });

        BtnEliminar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/ELIMINAR.JPG"))); // NOI18N
        BtnEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnEliminarActionPerformed(evt);
            }
        });

        BtnSalir.setIcon(new javax.swing.ImageIcon(getClass().getResource("/IMAGENES/SALIR.JPG"))); // NOI18N
        BtnSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BtnSalirActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(Nuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BtnModificar, javax.swing.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Guardar, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(BtnCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(BtnEliminar, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BtnSalir, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(BtnEliminar, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(BtnSalir, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(2, 2, 2)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(Guardar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(BtnCancelar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(BtnModificar, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                            .addComponent(Nuevo, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(0, 0, Short.MAX_VALUE)))
                        .addContainerGap())))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(15, 15, 15)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jPanel3.getAccessibleContext().setAccessibleName("Productos");

        jLabel1.setText("FORMULARIO DE ARTICULOS");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jLabel1)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        setSize(new java.awt.Dimension(687, 489));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents
 //evento Encargado de Verificar que el valor de TxtPrecio sea solo numerico
    
    private void TxtPrecioCompraKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TxtPrecioCompraKeyTyped
         boolean punto;
                                    char caracter;
				    caracter=(evt.getKeyChar()+"").charAt(0);
				    if (TxtPrecioCompra.getText().length()<10)
				       {if ((caracter+"").matches("[0-9.]"))
				            {if (caracter=='.')
				               {punto=false;
				            	for (int x=0;x<TxtPrecioCompra.getText().length();x++){
				            		if (TxtPrecioCompra.getText().substring(x,x+1).equals("."))
				            		{punto=true;}
				            	}
				                if (punto==false)
				                    {evt.setKeyChar(caracter);}
				                 else
				                    {evt.consume();}
				                }
				             else
				    	        {evt.setKeyChar(caracter);}
				            }
				        else
				           {evt.consume();}
				    	}
				    else
				        {evt.consume();}       
              
    }//GEN-LAST:event_TxtPrecioCompraKeyTyped
//Evento que permite la inclusion de puntos en TxtPrecio
            
    private void TxtPrecioCompraFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_TxtPrecioCompraFocusLost
        // TODO add your handling code here:
        if (TxtPrecioCompra.getText().length()==0)
	  {TxtPrecioCompra.setText("0.00");}
            double precio;
		precio = Double.parseDouble(TxtPrecioCompra.getText());
		NumberFormat redondeo = NumberFormat.getInstance();
		redondeo.setMaximumFractionDigits(2);
		redondeo.setMinimumFractionDigits(2);
                String sueldoletra=(redondeo.format(precio));
		String letra=("");
		String preciocambiado=("");
		for (int x=1;x<=sueldoletra.length();x++){
		letra=sueldoletra.substring(x-1,x);
                if (letra.equals(",")==true)
                         {letra=".";}
                else if(letra.equals(".")==true)
                         {letra="";}
                preciocambiado=preciocambiado+letra;
                    }
                TxtPrecioCompra.setText(preciocambiado);
		    
    }//GEN-LAST:event_TxtPrecioCompraFocusLost
       //evento Encargado de Verificar que el valor de TxtCantidad sea solo numerico
    private void TxtCantidadKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TxtCantidadKeyTyped
        if(!Character.isDigit(evt.getKeyChar()) && !Character.isISOControl(evt.getKeyChar()))
        {
            Toolkit.getDefaultToolkit().beep();
            evt.consume();
            }
              
    }//GEN-LAST:event_TxtCantidadKeyTyped
//Evento de Busqueda del primer articulo
    private void BtnPrimerArtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnPrimerArtActionPerformed
        // TODO add your handling code here:
        try{
		resultado.first();
		actualizar();
		}
		catch(Exception f){}
    }//GEN-LAST:event_BtnPrimerArtActionPerformed
//Evento de Busqueda del anterior articulo
    private void BtnAnteriorArtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnAnteriorArtActionPerformed
        // TODO add your handling code here:
        try{
            if (resultado.isBeforeFirst()==false){
		resultado.previous();
		if (resultado.isBeforeFirst()==true)
                   {resultado.first();}
                   actualizar();
                    }
		}
	catch(Exception p){}
    }//GEN-LAST:event_BtnAnteriorArtActionPerformed
   
    private void BtnBuscarArtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnBuscarArtActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_BtnBuscarArtActionPerformed
   //Evento de Busqueda del siguiente articulo
    private void BtnSiguienteArtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnSiguienteArtActionPerformed
        // TODO add your handling code here:
        try{
            if (resultado.isAfterLast()==false){
                resultado.next();
		if (resultado.isAfterLast()==true)
		   {resultado.last();}
                       actualizar();
			}
			}
		catch(Exception p){}
    }//GEN-LAST:event_BtnSiguienteArtActionPerformed
     //Evento de Busqueda del ultimo articulo
    private void BtnUltimoArtActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnUltimoArtActionPerformed
        // TODO add your handling code here:
        try{
            resultado.last();
            actualizar();
            }
            catch(Exception a){}
    }//GEN-LAST:event_BtnUltimoArtActionPerformed

    private void TxtPVPKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TxtPVPKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_TxtPVPKeyTyped

    private void TxtPVPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_TxtPVPActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_TxtPVPActionPerformed

    private void TxtPrecioVentaFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_TxtPrecioVentaFocusLost
        // TODO add your handling code here:
         if (TxtPrecioVenta.getText().length()==0)
	  {TxtPrecioVenta.setText("0.00");}
            double precio;
		precio = Double.parseDouble(TxtPrecioVenta.getText());
		NumberFormat redondeo = NumberFormat.getInstance();
		redondeo.setMaximumFractionDigits(2);
		redondeo.setMinimumFractionDigits(2);
                String sueldoletra=(redondeo.format(precio));
		String letra=("");
		String preciocambiado=("");
		for (int x=1;x<=sueldoletra.length();x++){
		letra=sueldoletra.substring(x-1,x);
                if (letra.equals(",")==true)
                         {letra=".";}
                else if(letra.equals(".")==true)
                         {letra="";}
                preciocambiado=preciocambiado+letra;
                    }
                TxtPrecioVenta.setText(preciocambiado);
    }//GEN-LAST:event_TxtPrecioVentaFocusLost

    private void TxtPrecioVentaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_TxtPrecioVentaKeyTyped
        // TODO add your handling code here:
         boolean punto;
                                    char caracter;
				    caracter=(evt.getKeyChar()+"").charAt(0);
				    if (TxtPrecioVenta.getText().length()<10)
				       {if ((caracter+"").matches("[0-9.]"))
				            {if (caracter=='.')
				               {punto=false;
				            	for (int x=0;x<TxtPrecioVenta.getText().length();x++){
				            		if (TxtPrecioVenta.getText().substring(x,x+1).equals("."))
				            		{punto=true;}
				            	}
				                if (punto==false)
				                    {evt.setKeyChar(caracter);}
				                 else
				                    {evt.consume();}
				                }
				             else
				    	        {evt.setKeyChar(caracter);}
				            }
				        else
				           {evt.consume();}
				    	}
				    else
				        {evt.consume();}       
              
    }//GEN-LAST:event_TxtPrecioVentaKeyTyped

    private void BtnSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnSalirActionPerformed
        // TODO add your handling code here:
        int resp=JOptionPane.showConfirmDialog(null,"Desea salir del formulario?","Salir del formulario",0);
        if(resp==0)
        {dispose();}
    }//GEN-LAST:event_BtnSalirActionPerformed

    private void BtnEliminarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnEliminarActionPerformed
        // TODO add your handling code here:
        int respuesta=JOptionPane.showConfirmDialog(null, "Desea eliminar el registro del Articulo "+TxtId.getText().trim()+" "+"?", "Eliminar Articulo",0, 3);
        if (respuesta==0){
            eliminar();
        }

    }//GEN-LAST:event_BtnEliminarActionPerformed

    private void BtnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnCancelarActionPerformed
        // TODO add your handling code here:
        try{
            int respuesta=JOptionPane.showConfirmDialog(null, "Desea descartar los datos ingresados?", "Cancelar ingresos",0, 3);
            if (respuesta==0){
                sentencia.executeQuery("select * from articulos order by id_art");
                resultado=sentencia.getResultSet();

                habilitaguacan();

                if (resultado.next()==false)
                {if (nuevoreg==false)
                    {JOptionPane.showMessageDialog(null,"Los datos de este articulo acaban de ser eliminados por otro usuario del sistema!","Vendedor inexistente",0);
                    }
                    limpiar();
                    vacio();
                }
                else
                {if(nuevoreg==true)
                    {resultado.last();
                        actualizar();
                    }
                    else
                    {elcodigo=TxtId.getText();
                        //encuentra();
                    }
                }
            }
        }
        catch(Exception s){}

    }//GEN-LAST:event_BtnCancelarActionPerformed

    private void GuardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_GuardarActionPerformed

        double elprecio=Double.parseDouble(TxtPrecioCompra.getText());
        double elprecioventa=Double.parseDouble(TxtPrecioVenta.getText());

        if
        (TxtNombre.getText().trim().length()==0){
            JOptionPane.showMessageDialog(null,"Ingrese el Nombre del Producto!", "Error de almacenamiento", 2);
            TxtNombre.requestFocus();
        }
        

        else if(elprecio==0){

            JOptionPane.showMessageDialog(null,"Ingrese el Precio de compra del Producto!", "Error de almacenamiento", 2);
            TxtPrecioCompra.requestFocus();
        }

        else if(elprecioventa==0){

            JOptionPane.showMessageDialog(null,"Ingrese el Precio de Venta del Producto!", "Error de almacenamiento", 2);
            TxtPrecioVenta.requestFocus();
        }

        else if(TxtCantidad.getText().trim().length()==0){
            JOptionPane.showMessageDialog(null,"Ingrese es Stock de Producto!", "Error de almacenamiento", 2);
            TxtCantidad.requestFocus();
        }
        else if(TxtMarca.getText().trim().length()==0){
            JOptionPane.showMessageDialog(null,"Ingrese la Marca del Producto!", "Error de almacenamiento", 2);
            TxtMarca.requestFocus();
        }
        else if(TxtPais.getText().trim().length()==0){
            JOptionPane.showMessageDialog(null,"Ingrese el Pais de Origen Producto!", "Error de almacenamiento", 2);
            TxtPais.requestFocus();
        }
        else{
            guardar();
        }

    }//GEN-LAST:event_GuardarActionPerformed

    private void BtnModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BtnModificarActionPerformed
        // TODO add your handling code here:
        nuevoreg=false;
        habilitanuemod();
        TxtNombre.requestFocus();
    }//GEN-LAST:event_BtnModificarActionPerformed

    private void NuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_NuevoActionPerformed
        // TODO add your handling code here:

        nuevoreg=true;
        limpiar();
        generacodigo();
        habilitanuemod();
        TxtNombre.requestFocus();

    }//GEN-LAST:event_NuevoActionPerformed
   
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Productos.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Productos().setVisible(true);
            }
        });
    }
    
    
    //Metodo que genera automaticamente el codigo de articulos de manera incremental
    public void generacodigo(){
		try{
			if (xregistros==0)
			   {TxtId.setText("AR0001"); }
			else{
			   resultado.last();
			   String numerocad=(resultado.getString("id_art").substring(2));
			   String cadnuevo=String.valueOf(Integer.valueOf(numerocad)+1);
			   int x;
			   String ceros=("");
			   for (x=1;x<=4-cadnuevo.length();x++)
			       {ceros=ceros+"0";}
			   TxtId.setText("AR"+ceros+cadnuevo);
			   if (cadnuevo.length()==5)
			      {TxtId.setText("");
			      JOptionPane.showMessageDialog(null, "No se puede generar el codigo. Se ha superado la capacidad del sistema!","Desbordamiento de valores",0);
                              dispose();
                              }
			}
		}
		catch(SQLException | NumberFormatException | HeadlessException g){
		}
	}
    
    
    
    public void conectar(){
		try
	    {Class.forName("com.mysql.jdbc.Driver").newInstance();
	     conexion=DriverManager.getConnection("jdbc:mysql://localhost/facturacion","root","city123");
		 sentencia=conexion.createStatement();
		 sentencia.executeQuery("SELECT * FROM articulos ORDER BY ID_ART");
		 resultado=sentencia.getResultSet();
		 if (resultado.next()==false)
		    {vacio();
		     xregistros=0;
                    }
		 else
		    {xregistros=1;
                     resultado.last();
		     actualizar();
			 }
	    }
	    catch( ClassNotFoundException | InstantiationException | IllegalAccessException | SQLException e )
	    {JOptionPane.showMessageDialog(null,"Ha ocurrido un error al intentar acceder los datos de articulos!", "Error de acceso", 2);
        }
	}
    
        public void eliminar(){
        
            try{
               {sentencia=conexion.createStatement();
                sentencia.executeUpdate("DELETE FROM ARTICULOS WHERE ID_ART='"+TxtId.getText()+"'");
		JOptionPane.showMessageDialog(null,"Los datos del Articulo han sido eliminados!", "Eliminacion de datos", 1);
		sentencia.executeQuery("SELECT * FROM ARTICULOS ORDER BY ID_ART");
		resultado=sentencia.getResultSet();
                        if (resultado.next()==false)
			    {xregistros=0;
				limpiar();
				vacio();}
			else
			    {xregistros=1;
			     resultado.last();
			     actualizar();
				 }
			  }
			}
		  catch( Exception e ){
			JOptionPane.showMessageDialog(null,"Ha ocurrido un error al intentar eliminar los datos del Articulo!", "Error de eliminaciòn", 2);
		}     
        
        }
        
        
        
        
    
        private void guardar(){
        
         try {
            // TODO add your handling code here:
             
              if (nuevoreg==true){ //autoriza la peticcion de nuevo articulo sino permite el update
                sentencia=conexion.createStatement();
                sentencia.executeUpdate("INSERT INTO ARTICULOS VALUES('"+TxtId.getText()+"','"+TxtNombre.getText()+"','"+TxtMarca.getText()+"','"+TxtPais.getText()+ 
				                 "','"+TxtCantidad.getText()+
				                 "','"+TxtPrecioVenta.getText()+"','"+TxtPrecioCompra.getText()+"','"+Constante+"','"+Constante+"')");
                xregistros=1;
              }
              else
              {
              sentencia.executeUpdate("UPDATE ARTICULOS SET DES_ART='"+TxtNombre.getText()+"',MARCA='"+TxtMarca.getText()+"',PAIS='"+TxtPais.getText()+"',STOCK='"+TxtCantidad.getText()+"',PVP_ART='"+TxtPrecioVenta.getText()+"',PCO_ART='"+TxtPrecioCompra.getText()+"',EX_MAX='"+ Constante +"',EX_MIN='"+Constante+ "'WHERE ID_ART='"+TxtId.getText()+"'");
                            
              }
              
              sentencia.executeQuery("SELECT * FROM ARTICULOS ORDER BY ID_ART");
		 resultado=sentencia.getResultSet();
		
                 if (nuevoreg==true)
			{resultado.last();
			 actualizar();}
		 else
		    {elcodigo=TxtId.getText();
		 encuentra();}
		 JOptionPane.showMessageDialog(null,"Los datos del Articulo han sido guardados!", "Almacenamiento de datos", 1);
		 habilitaguacan();
              
           
                                
              
        } 
         
         
         catch (SQLException ex) {
            Logger.getLogger(Productos.class.getName()).log(Level.SEVERE, null, ex);
        }
         
	}
        
        private void encuentra(){
		try{
			sentenciaxreg=conexion.createStatement();
			sentenciaxreg.executeQuery("SELECT COUNT(ID_ART)AS CUANTOSART FROM ARTICULOS");
			resultadoxreg=sentenciaxreg.getResultSet();
			resultadoxreg.last();
			resultado.first();
			for (int x=1;x<=resultadoxreg.getInt("CUANTOSART");x++)
			{   if (resultado.getString("id_art").equals(elcodigo)==true)
			 	{break;
				}
				resultado.next();
			}
			if (resultado.isAfterLast()==true)
			{  JOptionPane.showMessageDialog(null,"El Articulo no pudo ser localizado!", "Error de busqueda", 2);
			   resultado.last();
			}
			actualizar();
			}
		catch(Exception m)
			{JOptionPane.showMessageDialog(null,"El Articulo no pudo ser localizado!", "Error de busqueda", 2);
			}
	}
    
    
         private void actualizar(){
		try{
	 	 
                 TxtId.setText(resultado.getString("id_art"));
		 TxtNombre.setText(resultado.getString("des_art"));
                 TxtMarca.setText(resultado.getString("marca"));
                 TxtPais.setText(resultado.getString("pais"));
                 TxtCantidad.setText(resultado.getString("stock"));
		 TxtPrecioCompra.setText(resultado.getString("pco_art"));
                 TxtPrecioVenta.setText(resultado.getString("pvp_art"));
		
		 
		}
		catch (Exception m){
		}
	}
    
    
        
    
         private void limpiar(){
		   
        TxtId.setText("");
	TxtNombre.setText("");
        TxtMarca.setText("");
        TxtPais.setText("");
        TxtPrecioCompra.setText("0.00");
	
        TxtPrecioVenta.setText("0.00");
        TxtCantidad.setText("");
		  
		   }
    
    
        public void habilitanuemod(){
		Nuevo.setEnabled(false);
		BtnModificar.setEnabled(false);
		Guardar.setEnabled(true);
		BtnCancelar.setEnabled(true);
		BtnEliminar.setEnabled(false);
		BtnPrimerArt.setEnabled(false);
		BtnAnteriorArt.setEnabled(false);
		BtnBuscarArt.setEnabled(false);
		BtnSiguienteArt.setEnabled(false);
		BtnUltimoArt.setEnabled(false);
	}
    
        public void habilitaguacan(){
		Nuevo.setEnabled(true);
		BtnModificar.setEnabled(true);
		Guardar.setEnabled(false);
		BtnCancelar.setEnabled(false);
		BtnEliminar.setEnabled(true);
		
                BtnPrimerArt.setEnabled(true);
		BtnAnteriorArt.setEnabled(true);
		BtnBuscarArt.setEnabled(true);
		BtnSiguienteArt.setEnabled(true);
		BtnUltimoArt.setEnabled(true);
		
               // TxtNombre.setEnabled(false);
		//TxtPrecio.setEnabled(false);
		//TxtCantidad.setEnabled(false);
	}
    
    
    
    
    
        
        private void vacio(){
            
               
        }
       
       
       
    
    
    
    
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BtnAnteriorArt;
    private javax.swing.JButton BtnBuscarArt;
    private javax.swing.JButton BtnCancelar;
    private javax.swing.JButton BtnEliminar;
    private javax.swing.JButton BtnModificar;
    private javax.swing.JButton BtnPrimerArt;
    private javax.swing.JButton BtnSalir;
    private javax.swing.JButton BtnSiguienteArt;
    private javax.swing.JButton BtnUltimoArt;
    private javax.swing.JButton Guardar;
    private javax.swing.JButton Nuevo;
    private javax.swing.JTextField TxtCantidad;
    private javax.swing.JTextField TxtId;
    private javax.swing.JTextField TxtMarca;
    private javax.swing.JTextField TxtNombre;
    private javax.swing.JTextField TxtPVP;
    private javax.swing.JTextField TxtPais;
    private javax.swing.JTextField TxtPrecioCompra;
    private javax.swing.JTextField TxtPrecioVenta;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabelCantidad;
    private javax.swing.JLabel jLabelMarca;
    private javax.swing.JLabel jLabelMarca1;
    private javax.swing.JLabel jLabelNombre;
    private javax.swing.JLabel jLabelPrecioCompra;
    private javax.swing.JLabel jLabelPrecioVenta;
    private javax.swing.JLabel jLabelProducto;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    // End of variables declaration//GEN-END:variables
}
